package com.tjetc.domain;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "user")
public class User implements Serializable {
    @Serial
    private static final long serialVersionUID = -1519402327720227835L;
    /**
    * 用户
    */
    @Id //文档的主键,唯一标识
    @Field(type = FieldType.Integer,store = true,index = false)
    private Integer id;

    /**
    * 用户名
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String username;

    /**
    * 手机号
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String phone;

    /**
    * 密码
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String password;

    /**
    * 性别
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String sex;

    /**
    * 生日
    */
    @Field(type=FieldType.Date,index = true,store = true)
    private Date birthday;

    /**
    * 头像
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String icon;

    /**
    * 背景图
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String backgroundimg;

    /**
    * 简介
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String desc;

    /**
    * 粉丝数量
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private Integer fansNum;

    /**
    * 关注数量
    */
    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private Integer followNum;

    /**
    * 互动数量
    */
    @Field(type=FieldType.Integer,index = false,store = true)
    private Integer interactionNum;

    /**
     * 注册时间
     */
    @Field(type=FieldType.Date,index = true,store = true)
    private Date createTime;
}